/**
 * Copyright (C) 2024-2030 Super BilGen & 超亿时代信息技术股份有限公司.All Rights Reserved.
 */
package cn.com.yang.threadpool;

import java.util.concurrent.RejectedExecutionException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Model cn.com.yang.threadpool.AbortPolicy
 * @Desc  TODO
 * @author yangyijin
 * @since 2025年9月4日-下午7:42:40
 */
public class AbortPolicy implements RejectionPolicy {
	private static final Logger logger = LoggerFactory.getLogger(AbortPolicy.class);
    @Override
    public void reject(Runnable task, CustomThreadPool pool) {
        logger.error("Task rejected: {}", task);
        throw new RejectedExecutionException("Task " + task + " rejected from " + pool);
    }
}